#gui稳定
function fislandpp:machines/auto_grinder/gui
function fislandpp:machines/auto_grinder/power_bar
#能量减少
execute if score @s fisland_ag_power matches 1.. run scoreboard players remove @s fisland_ag_power 1
#充能
execute if score @s fisland_ag_power matches ..8400 if block ~ ~ ~ barrel{Items:[{Slot:16b,id:"minecraft:coal"}]} if block ~ ~ ~ barrel{Items:[{id:"minecraft:cobblestone"}]} run function fislandpp:machines/auto_grinder/charge
execute if score @s fisland_ag_power matches ..8400 if block ~ ~ ~ barrel{Items:[{Slot:16b,id:"minecraft:charcoal"}]} if block ~ ~ ~ barrel{Items:[{id:"minecraft:cobblestone"}]} run function fislandpp:machines/auto_grinder/charge
execute if score @s fisland_ag_power matches ..8400 if block ~ ~ ~ barrel{Items:[{Slot:16b,id:"minecraft:coal"}]} if block ~ ~ ~ barrel{Items:[{id:"minecraft:stone"}]} run function fislandpp:machines/auto_grinder/charge
execute if score @s fisland_ag_power matches ..8400 if block ~ ~ ~ barrel{Items:[{Slot:16b,id:"minecraft:charcoal"}]} if block ~ ~ ~ barrel{Items:[{id:"minecraft:stone"}]} run function fislandpp:machines/auto_grinder/charge
#有能量则粉碎
scoreboard players operation $fisland_t_m_a_tick fisland_temp = @s fisland_ag_power
scoreboard players operation $fisland_t_m_a_tick fisland_temp %= $C_10 fisland_temp
execute if score $fisland_t_m_a_tick fisland_temp matches 1 run function fislandpp:machines/hand_grinder/grind